package org.zfes.snowier.cloud.zbss.cms.router.service.content;

import java.util.Map;
import java.util.Optional;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.zfes.snowier.core.data.DataSet;
import org.zfes.snowier.web.controller.BaseController;
import org.zfes.snowier.cloud.zbss.cms.content.model.CmsContentCount;
import org.zfes.snowier.cloud.zbss.cms.content.service.ICmsContentCountService;
@Controller("org.zfes.snowier.cloud.zbss.cms.router.service.content.CmsContentCountController") 
@RequestMapping("/cms/service/content/cmsContentCount")
public class CmsContentCountController extends BaseController {

	
	@Autowired
	private ICmsContentCountService cmsContentCountService;
	
	@RequiresPermissions(value="cmsContentCount:loadCmsContentCountDataSet",desc="内容统计列表")
    @RequestMapping(value="/loadCmsContentCountDataSet", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    public @ResponseBody  Object loadCmsContentCountDataSet(@RequestParam Map<String,Object> params){
	    DataSet dataSet=  cmsContentCountService.loadCmsContentCountDataSet(params);
	    return ajaxQuery("dataSet", dataSet);
    }
	
	@RequiresPermissions(value="cmsContentCount:createCmsContentCount",desc="内容统计添加")
    @RequestMapping(value="/createCmsContentCount", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    public  @ResponseBody Object createCmsContentCount(CmsContentCount cmsContentCount){
		cmsContentCountService.createCmsContentCount(cmsContentCount);
    	return ajaxDoneSuccess("数据操作成功 ");
    }
	
	@RequiresPermissions(value="cmsContentCount:loadCmsContentCount",desc="内容统计加载")
    @RequestMapping(value="/loadCmsContentCount", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    public @ResponseBody  Object loadCmsContentCount(Long id){
		Optional<CmsContentCount> ops = cmsContentCountService.loadCmsContentCountById(id);
		return ajaxQuery("cmsContentCount",ops);
    }
	
	@RequiresPermissions(value="cmsContentCount:updateCmsContentCount",desc="内容统计更新")
    @RequestMapping(value="/updateCmsContentCount", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    public @ResponseBody  Object updateCmsContentCount(CmsContentCount cmsContentCount){
		cmsContentCountService.updateCmsContentCount(cmsContentCount);
		return ajaxDoneSuccess("数据操作成功 ");
    }
	
	@RequiresPermissions(value="cmsContentCount:deletCmsContentCount",desc="内容统计删除")
    @RequestMapping(value="/deleteCmsContentCount", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    public @ResponseBody  Object deleteCmsContentCount(Long id){
		cmsContentCountService.deleteCmsContentCount(id);
		return ajaxDoneSuccess("数据操作成功 ");
    }

}